package 题目集.dfs.全排列;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;
import java.util.Arrays;

/**
 * https://www.acwing.com/problem/content/description/4960/
 */
public class ch02飞机降落 {
    static int maxN = 11, maxT = (int) 1e5 + 1;
    static int n;
    static int[][] arr = new int[maxN][4];    //0位置起点，1位置待机时间，2位置下降时间，3位置最迟落地时间

    public static void main(String[] args) {
        Reader sc = new Reader();
        int t = sc.nextInt();
        while (t-- > 0) {
            n = sc.nextInt();
            for (int i = 0; i < n; i++) {
                arr[i][0] = sc.nextInt();
                arr[i][1] = sc.nextInt();
                arr[i][2] = sc.nextInt();
                arr[i][3] = arr[i][0] + arr[i][1];
            }
            Arrays.sort(arr, 0, n, (a, b) -> a[3] - b[3]);
            if (dfs(0, 0)) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }
    }

    static boolean[] vis = new boolean[maxN];

    public static boolean dfs(int cnt, int time) {
        if (cnt == n) return true;

        for (int i = 0; i < n; i++) {
            int ddl = arr[i][0] + arr[i][1];
            if (vis[i]||ddl<time) continue;
            vis[i] = true;
            if (dfs(cnt + 1, Math.max(time,  arr[i][0]) + arr[i][2])) {
                vis[i] = false;
                return true;
            }
            vis[i] = false;
        }
        return false;
    }

    static class Reader {
        static StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));

        public static int nextInt() {
            try {
                in.nextToken();
            } catch (Exception ignored) {
            }
            return (int) in.nval;
        }
    }
}
